using UnityEngine;

public class PlayerAIState_Offense_GetLoose : State<PlayerAI>
{
	public static PlayerAIState_Offense_GetLoose instance;

	private PlayerAIState_Offense_GetLoose()
	{
	}

	public static PlayerAIState_Offense_GetLoose getInstance()
	{
		if (instance == null)
		{
			instance = new PlayerAIState_Offense_GetLoose();
		}
		return instance;
	}

	public override void enter(PlayerAI owner)
	{
		base.enter(owner);
		owner.player.do_idle();
	}

	public override void fixedUpdate(PlayerAI owner)
	{
		base.fixedUpdate(owner);
		if (owner.time_Stop > 0f)
		{
			if (owner.player.isInState(PlayerStateBehavior_Idle.getInstance()))
			{
				owner.time_Stop -= Time.fixedDeltaTime;
			}
			if (owner.player.team.IsAnyOneControlBall())
			{
				owner.player.LookAtSmooth(owner.player.team.getPlayer_ControlBall().getPosition());
			}
			if (owner.player.team.IsAnyOneControlBall() && MathHelper.getSqrDistance(owner.player.team.getPlayer_ControlBall().getPosition(), owner.player.getPosition()) < 4f)
			{
				owner.do_offense_findpos();
			}
		}
		else
		{
			owner.do_offense_findpos();
		}
	}
}
